const { OK, SERVER_ERROR } = require('./reponseState')
const Result = {
  ok(data) {
    return {
      status: OK,
      data,
      msg: 'OK'
    }
  },
  ok2(data, length) {
    return {
      status: OK,
      data,
      length,
      msg: 'OK'
    }
  },
  error() {
    return {
      status: SERVER_ERROR,
      data: null,
      msg: '服务器内部错误'
    }
  },
  error2(status, msg) {
    return {
      status,
      data: null,
      msg
    }
  }
}
module.exports = Result